package com.ecnu.system.domain.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.NotBlank;

@Data
public class ProjectUserFalseDTO {
    private String id;
    @ApiModelProperty(value = "活动ID")
    @NotBlank(message = "活动ID不能为空")
    private String proId;
    @ApiModelProperty(value = "人员ID")
    private String userId;
    @ApiModelProperty(value = "审核状态（0审核，2未通过")
    @NotBlank(message = "审核状态不能为空")
    private String status;
    @ApiModelProperty(value = "审核意见")
    private String opinion;

    @AssertTrue(message = "审核状态为驳回时，审核意见不能为空")
    public boolean isRegistrationTimeValid() {
        if ("2".equals(status)) {
            return opinion != null && opinion  != "";
        }
        return true;
    }
}
